* Compute export shares from WIOD 
use "WIOD/input/wiot_full.dta", clear
drop if row_item>35 // restrict to the 35 sectors
bys year row_country: egen value_temp2 = total(value) // total sales to entire world
bys year row_country col_country: egen value_temp = total(value) // aggregate across uses for each destination
keep if row_country==col_country
keep if col_item==1 // eliminate col_items
keep if row_item==1
drop row_item col_item col_country value // country level
sort year row_country 
gen domshare = value_temp / value_temp2
gen exportshare = 1-domshare
rename row_country ccode
drop value_temp2 value_temp domshare
order ccode, first
sort ccode year
save "WIOD/output/exportsharesWIOD.dta", replace

